// Just a mock data

const constantRoutes = [
  {
    path: '/redirect',
    component: 'layout/Layout',
    hidden: true,
    children: [
      {
        path: '/redirect/:path*',
        component: 'views/redirect/index'
      }
    ]
  },
  {
    path: '/login',
    component: 'views/login/index',
    hidden: true
  },
  {
    path: '/auth-redirect',
    component: 'views/login/auth-redirect',
    hidden: true
  },
  {
    path: '/404',
    component: 'views/error-page/404',
    hidden: true
  },
  {
    path: '/401',
    component: 'views/error-page/401',
    hidden: true
  },
  {
    path: '',
    component: 'layout/Layout',
    redirect: 'dashboard',
    children: [
      {
        path: 'dashboard',
        component: 'views/dashboard/index',
        name: 'Dashboard',
        meta: { title: 'Dashboard', icon: 'dashboard', affix: true }
      }
    ]
  }
]

const asyncRoutes = [
  
   // 广告管理
   {
    path: '/manage-ad',
    component: 'layout/Layout',
    redirect: '/manage-ad/list',
    name: '广告管理',
    meta: {
      title: '广告管理',
      icon: 'ad',
      roles:['admin','editor']
    },
    children: [
      {
        path: 'create',
        component:'views/manage-ad/create',
        name: 'CreateAd',
        meta: {
          title: 'Create Ad',
          icon: 'edit'
        }
      },
      {
        path: 'edit/:id(\\d+)',
        component:'views/manage-ad/list',
        name: 'EditAd',
        meta: {
          title: 'Edit Ad',
          noCache: true,
          activeMenu: '/manage-ad/list'
        },
        hidden: true
      },
      {
        path: 'list',
        component:'views/manage-ad/list',
        name: 'AdList',
        meta: { title: 'Ad List', icon: 'list' }
      }
    ]
  },
  // 任务管理
  {
    path: '/manage-task',
    component: 'layout/Layout',
    redirect: '/manage-task/list',
    name: '任务管理',
    meta: {
      title: '任务管理',
      icon: 'task',
      roles:['admin','editor']
    },
    children: [
      {
        path: 'create',
        component:'views/manage-task/create',
        name: 'CreateTask',
        meta: {
          title: 'Create Task',
          icon: 'edit'
        }
      },
      {
        path: 'edit/:id(\\d+)',
        component:'views/manage-task/list',
        name: 'EditTask',
        meta: {
          title: 'Edit Task',
          noCache: true,
          activeMenu: '/manage-task/list'
        },
        hidden: true
      },
      {
        path: 'list',
        component:'views/manage-task/list',
        name: 'TaskList',
        meta: { title: 'Task List', icon: 'list' }
      }
    ]
  },
  // 学生管理
  {
    path: '/manage-student',
    component: 'layout/Layout',
    redirect: '/manage-student/list',
    name: '学生管理',
    meta: {
      title: '学生管理',
      icon: 'student',
      roles:['admin','editor']
    },
    children: [
      {
        path: 'upload',
        component:'views/manage-student/upload',
        name: 'UploadStudent',
        meta: {
          title: 'Upload Student',
          icon: 'edit'
        }
      },
      {
        path: 'edit/:id(\\d+)',
        component:'views/manage-student/list',
        name: 'EditStudent',
        meta: {
          title: 'Edit Student',
          noCache: true,
          activeMenu: '/manage-student/list'
        },
        hidden: true
      },
      {
        path: 'list',
        component:'views/manage-student/list',
        name: 'StudentList',
        meta: { title: 'Student List', icon: 'list' }
      }
    ]
  },
  // 礼品管理
  {
    path: '/manage-gift',
    component: 'layout/Layout',
    redirect: '/manage-gift/list',
    name: '礼品管理',
    meta: {
      title: '礼品管理',
      icon: 'gift',
      roles:['admin','editor']
    },
    children: [
      {
        path: 'create',
        component:'views/manage-gift/create',
        name: 'CreateGift',
        meta: {
          title: 'Create Gift',
          icon: 'edit'
        }
      },
      {
        path: 'edit/:id(\\d+)',
        component:'views/manage-gift/list',
        name: 'EditGift',
        meta: {
          title: 'Edit Gift',
          noCache: true,
          activeMenu: '/manage-gift/list'
        },
        hidden: true
      },
      {
        path: 'list',
        component:'views/manage-gift/list',
        name: 'GiftList',
        meta: { title: 'Gift List', icon: 'list' }
      }
    ]
  },
  //权限管理
  {
    path: '/permission',
    component: 'layout/Layout',
    redirect: '/permission/role',
    children: [
      {
        path: 'role',
        component: 'views/permission/role',
        name: 'Permission',
        meta: { title: '权限管理', icon: 'lock', roles:['admin']}
      }
    ]
  },

  { path: '*', redirect: '/404', hidden: true }
]

module.exports = {
  constantRoutes,
  asyncRoutes
}
